using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;
using NetWorkMsg;

namespace NetMsg.ParallelWorld
{
    // 平行世界状态
    public enum ParallelWorldState
    {
        Make,
        WaitToMake,
        WaitToMatch,
        Match,
        Reward,
        ConfirmReward,
    }
    
    public struct GetParallelWorldQ : IServerCallbackable
    {
        
        public uint UnPackableId => 76;
        public uint PackableId => 101;
        
        public void Pack(MemoryStream stream)
        {
            PackAuxiliary.Write(stream, 101u);
        }
    }
    
    public struct GetParallelWorldP : IUnPackable
    {
        // 状态
        public ParallelWorldState State;
        // 状态持续时间 -1 代表客户端切换; >= 0 代表状态持续到的时间戳
        public int CoolTime;
        // 主题切换次数
        public int ThemeTimes;
        // 匹配次数
        public int MatchTimes;
        
        public const uint Sid = 76;
        
        public void UnPack(MemoryStream stream)
        {
            UnPackAuxiliary.Read(stream, out uint var0);
            State = (ParallelWorldState)var0;
            UnPackAuxiliary.Read(stream, out CoolTime);
            UnPackAuxiliary.Read(stream, out uint var1);
            ThemeTimes = (int)var1;
            UnPackAuxiliary.Read(stream, out uint var2);
            MatchTimes = (int)var2;
        }
    }
    
    // 状态改变结果
    public enum ChangeStateResult
    {
        Success,
        // 状态不对
        StateError,
    }
    
    // 取消漂流瓶生成
    public struct CancelMakeBottleQ : IServerCallbackable
    {
        
        public uint UnPackableId => 77;
        public uint PackableId => 102;
        
        public void Pack(MemoryStream stream)
        {
            PackAuxiliary.Write(stream, 102u);
        }
    }
    
    public class CancelMakeBottleP : IUnPackable
    {
        public ChangeStateResult Result;
        
        public const uint Sid = 77;
        
        public void UnPack(MemoryStream stream)
        {
            UnPackAuxiliary.Read(stream, out uint var0);
            Result = (ChangeStateResult)var0;
        }
    }
    
    // 发送漂流瓶
    public class SendDriftBottleQ : IServerCallbackable
    {
        // 主题
        public int Theme;
        public string Info;
        
        public uint UnPackableId => 78;
        public uint PackableId => 103;
        
        public void Pack(MemoryStream stream)
        {
            PackAuxiliary.Write(stream, 103u);
            PackAuxiliary.Write(stream, (uint)Theme);
            PackAuxiliary.Write(stream, Info);
        }
    }
    
    public struct SendDriftBottleP : IUnPackable
    {
        public ChangeStateResult Result;
        
        public const uint Sid = 78;
        
        public void UnPack(MemoryStream stream)
        {
            UnPackAuxiliary.Read(stream, out uint var0);
            Result = (ChangeStateResult)var0;
        }
    }
    
    // 切换主题
    public struct ChangeThemeQ : IIdPackable
    {
        
        public uint PackableId => 104;
        
        public void Pack(MemoryStream stream)
        {
            PackAuxiliary.Write(stream, 104u);
        }
    }
    
    public class DriftBottleInfo : IUnPackable
    {
        public long PlayerId;
        public string PlayerName;
        public int Theme;
        public string Info;
        
        public void UnPack(MemoryStream stream)
        {
            UnPackAuxiliary.Read(stream, out ulong var0);
            PlayerId = (long)var0;
            UnPackAuxiliary.Read(stream, out PlayerName);
            UnPackAuxiliary.Read(stream, out uint var1);
            Theme = (int)var1;
            UnPackAuxiliary.Read(stream, out Info);
        }
    }
    
    // 漂流瓶匹配结果
    public enum GetDriftBottleResult
    {
        Success,
        // 状态不对
        StateError,
        // 没有匹配次数了
        NoTimes,
    }
    
    // 匹配漂流瓶
    public struct GetDriftBottleQ : IServerCallbackable
    {
        
        public uint UnPackableId => 79;
        public uint PackableId => 105;
        
        public void Pack(MemoryStream stream)
        {
            PackAuxiliary.Write(stream, 105u);
        }
    }
    
    public class GetDriftBottleP : IUnPackable
    {
        public GetDriftBottleResult Result;
        // 可能没有
        public DriftBottleInfo Info;
        
        public const uint Sid = 79;
        
        public void UnPack(MemoryStream stream)
        {
            UnPackAuxiliary.Read(stream, out uint var0);
            Result = (GetDriftBottleResult)var0;
            UnPackAuxiliary.Read(stream, out bool var1);
            if(var1)
            {
                Info = new DriftBottleInfo();
                Info.UnPack(stream);
            }
        }
    }
    
    // 切换到领奖状态
    public struct ChangeToRewardQ : IServerCallbackable
    {
        
        public uint UnPackableId => 80;
        public uint PackableId => 106;
        
        public void Pack(MemoryStream stream)
        {
            PackAuxiliary.Write(stream, 106u);
        }
    }
    
    public class ChangeToRewardP : IUnPackable
    {
        public ChangeStateResult Result;
        
        public const uint Sid = 80;
        
        public void UnPack(MemoryStream stream)
        {
            UnPackAuxiliary.Read(stream, out uint var0);
            Result = (ChangeStateResult)var0;
        }
    }
    
    // 切换到确认状态
    public struct ChangeToConfirmQ : IServerCallbackable
    {
        
        public uint UnPackableId => 81;
        public uint PackableId => 107;
        
        public void Pack(MemoryStream stream)
        {
            PackAuxiliary.Write(stream, 107u);
        }
    }
    
    public class ChangeToConfirmP : IUnPackable
    {
        public ChangeStateResult Result;
        
        public const uint Sid = 81;
        
        public void UnPack(MemoryStream stream)
        {
            UnPackAuxiliary.Read(stream, out uint var0);
            Result = (ChangeStateResult)var0;
        }
    }
    
    // 领取匹配奖励
    public struct GetMatchRewardQ : IServerCallbackable
    {
        
        public uint UnPackableId => 82;
        public uint PackableId => 108;
        
        public void Pack(MemoryStream stream)
        {
            PackAuxiliary.Write(stream, 108u);
        }
    }
    
    public class GetMatchRewardP : IUnPackable
    {
        public ChangeStateResult Result;
        
        public const uint Sid = 82;
        
        public void UnPack(MemoryStream stream)
        {
            UnPackAuxiliary.Read(stream, out uint var0);
            Result = (ChangeStateResult)var0;
        }
    }
    
    public enum ParallelWorldEnum
    {
        GetParallelWorldP,
        CancelMakeBottleP,
        SendDriftBottleP,
        GetDriftBottleP,
        ChangeToRewardP,
        ChangeToConfirmP,
        GetMatchRewardP,
    }
}
